package com.xnyzc.lhy.statistics.controller.search;

import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.statistics.entity.order.OaCOrderPersonal;
import com.xnyzc.lhy.statistics.service.search.OrderSearchService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.List;

/**
 * 订单搜索服务类
 *
 * @author cuixiaojian
 */
@RestController
@RequestMapping("search/order")
public class OrderSearchController {

    @Autowired
    private OrderSearchService orderSearchService;

    @ApiModelProperty("保存订单")
    @PostMapping("saveOrder")
    public boolean saveOrder(
            @RequestBody OaCOrderPersonal oaCOrderPersonal
            ) {
        return orderSearchService.submitOrder(oaCOrderPersonal);
    }

    @ApiModelProperty("批次订单保存")
    @PostMapping("batchesSaveOrder")
    public boolean batchesSaveOrder(
            @RequestBody List<OaCOrderPersonal> oaCOrderPersonals
    ) {
        return orderSearchService.batchesSubmitOrder(oaCOrderPersonals);
    }

}
